<%#= javascript_include_tag "kindeditor/kindeditor" %>
<%= simple_form_for([:admin, @technical_core], html: {class: 'layui-form'}) do |f| %>
  <%= f.error_notification %>
    <div class="layui-form-item">
      <%= f.label :img, class: 'layui-form-label' %>
      <div class="layui-input-block">
        <div class="layui-upload-drag" id="test10">
          <i class="layui-icon"></i>
          <p>点击上传</p>
          <div class="<%= @technical_core&.img&.blank? ? "layui-hide": ""%>" id="uploadDemoView">
            <hr>
            <img src="<%= @technical_core&.img %>" alt="上传成功后渲染" style="max-width: 196px">
          </div>
        </div>
        <%= f.input_field :img, class: 'layui-input string', autocomplete: 'off', style: 'display: none;'%>
      </div>
    </div>

    <div class="layui-form-item">
      <%= f.label :title, class: 'layui-form-label' %>
      <div class="layui-input-block">
        <%= f.input_field :title, class: 'layui-input', :window_onload => true, autocomplete: 'off', placeholder: TechnicalCore.human_attribute_name(:title) %>
      </div>
    </div>

    <div class="layui-form-item">
      <%= f.label :content, class: 'layui-form-label' %>
      <div class="layui-input-block">
        <%= f.input_field :content, class: 'layui-input', class: 'layui-input', autocomplete: 'off', placeholder: TechnicalCore.human_attribute_name(:content) %>
      </div>
    </div>

    <div class="layui-form-item">
      <%= f.label :order_number, class: 'layui-form-label' %>
      <div class="layui-input-block">
        <%= f.input_field :order_number, class: 'layui-input', autocomplete: 'off', placeholder: TechnicalCore.human_attribute_name(:order_number) %>
      </div>
    </div>

    <div class="actions" hidden>
      <%= f.submit t('buttons.save'), data: { disable_with: "保存中..." }, class: 'layui-btn save_submit' %>
    <%= link_to t('buttons.cancel'), url_for(:back), class: 'layui-btn layui-btn-normal' %>
  </div>
<% end %>

<script>
  uploadIMGLI("#test10")
</script>